#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["BJ.Auth/BJ.Auth.csproj", "BJ.Auth/"]
COPY ["BJ.AuthApp/BJ.AuthApp.csproj", "BJ.AuthApp/"]
COPY ["BJ.AuthDomain/BJ.AuthDomain.csproj", "BJ.AuthDomain/"]
COPY ["BJ.AuthEntity/BJ.AuthEntity.csproj", "BJ.AuthEntity/"]
COPY ["Syspetro.Deploy/Syspetro.Deploy.csproj", "Syspetro.Deploy/"]
COPY ["Syspetro.Core/Syspetro.Core.csproj", "Syspetro.Core/"]
COPY ["SysPetro.Aliyun/Syspetro.Aliyun.csproj", "SysPetro.Aliyun/"]
RUN dotnet restore "BJ.Auth/BJ.Auth.csproj"
COPY . .
WORKDIR "/src/BJ.Auth"
RUN dotnet build "BJ.Auth.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "BJ.Auth.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "BJ.Auth.dll"]